<template>
	<view class="content">
			<!--空白页-->
			<view class="placeholderimg zwtimg" style="margin-top: 300rpx;" v-if="list.data.length==0">
				<image src="/static/image/bg-icons/placeholderimg.png" mode=""></image>
			</view>
		 <view class="padding_lrb">
		 	<view class="border padding ffffff aside" v-if="list.data.length" v-for="item in list.data" :key="item.id">
				<view class="flexbetween nav">
					<view class="black ziti">{{item.createtime_text}}</view>
					<view class="orange">已核销</view>
				</view>
				<view class="margin_top2 word_wubai black" v-for="ite in item.goods" :key="ite.id">
					<view class="margin_top2 word_wubai black">商品名：{{ite.title}}</view>
					<view class="margin_top2">
						数量：<text class="orange margin_right2">{{ite.number}}</text>
						规格：<text class="orange  margin_right2" v-if="ite.difference">{{ite.difference}}</text>
						
					</view>
					
				</view>
				<view class="margin_top2 word_wubai">合计金额：<text class="orange ">{{item.total_price}}</text></view>
				<view class="margin_top2 word_wubai black">订单号：{{item.order_no}}</view>
			</view>
		 </view>
	</view>
</template>
<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list: {
					data: []
				},
				limit: 12,
				page: 1,
			}
		},
		onShow() {
			this.init()
		},
		methods: {
			init(isPage, page) {
				let _this = this;
				httpRequest.request('api/order/hxMyOrder', 'GET', {
					page: page || 1,
					limit: _this.limit,
				}, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>
	.content{
		overflow: hidden;
	}
	.aside{
		margin-top: 30rpx;
	}
.nav{
	border-bottom: 1rpx solid rgba(241, 241, 241, 1);
	padding-bottom: 30rpx;
}
</style>
